<?php
declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class CreateAddColumnEpisodeIdInTaskTable extends AbstractMigration
{

    public function up()
    {
        $this->table('task')
            ->addColumn('episode_id', 'integer', ['limit' => 11, 'null' => false, 'signed' => false, 'default' => 0, 'comment' => '集id'])
            ->addIndex(['episode_id'], ['type' => 'normal', 'name' => 'idx_task_episode_id'])
            ->save();
    }

    public function down()
    {
        $this->table('task')
            ->removeColumn('episode_id')
            ->removeIndexByName('idx_task_episode_id')
            ->save();
    }
}
